<?php
declare(strict_types = 1);
namespace SimpleDingTalk\v2\AI;
use SimpleDingTalk\v2\ApiRequest;
use SimpleDingTalk\v2\Url;
class Messages
{
    public static function create(string $thread_id,array $body){
        $uri=Url::$api['ai']['threads']."/$thread_id/messages";
       
        $res=ApiRequest::post($uri,$body);
        return $res;
    }
    public static function remove(string $thread_id,string $msg_id){
        $uri=Url::$api['ai']['threads']."/$thread_id/messages/$msg_id";
       
        $res=ApiRequest::delete($uri);
        return $res;
    }

    public static function getList(array $params){
        $uri=Url::$api['ai']['threads']."/messages";
        $uri=ApiRequest::joinParams($uri,$params);
        $res=ApiRequest::get($uri);
        return $res;
    }
    public static function getBody(string $thread_id,string $msg_id){
        $uri=Url::$api['ai']['threads']."/$thread_id/messages/$msg_id";
        $res=ApiRequest::get($uri);
        return $res;
    }
}
